Skip to content
This repository has been archived by the owner on Feb 24, 2025. It is now read-only.

less prescriptive api call #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

BenfcAC
Copy link

@BenfcAC BenfcAC commented Apr 11, 2022

Create less prescriptive version of the api call

Comment on lines +18 to +21
fetch(url, { headers: { "x-api-version": "2" } })
.then(res => res.json())
.then(json => setData(json))
.catch(err => setError(err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added useSWR to help with the slow API but I do like the simplicity of this :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants